<?php
/**
 * Created by PhpStorm.
 * User: yiranblade
 * Date: 18-6-29
 * Time: 下午3:56
 */

namespace App\Http\Controllers;


use App\Http\Logic\GetMapPath;
use Illuminate\Http\Request;

class EnController extends Controller
{
    public function getPath(Request $request){
        $getMapPath=new GetMapPath();
        $start=$request->input('start');
        $end=$request->input('end');
        $path=$getMapPath->dijkstra($start,$end);
        if($path){
            return [
                'code'=>200,
                'data'=>$path
            ];
        }else{
            return [
                'code'=>500,
                'data'=>'查无此路径'
            ];
        }


    }

}